package com.tedu.aopdemo.aop;

import org.springframework.stereotype.Component;

@Component
public class CalculatorImpl implements Calculator{
    @Override
    public int add(int i, int j) {
        return i+j;
    }

    @Override
    public int sub(int i, int j) {
        return i-j;
    }

    @Override
    public int mul(int i, int j) {
        return i*j;
}

    @Override
    public int div(int i, int j) {

        if (j==0){
            throw new RuntimeException("除数不能为0");
        }
        return i/j;
    }
}
